package com.zr.share.enums;

/**
 * @ClassName InquiryCurrencyEnum
 * @Description TODO
 * @Author Jiakui_Ma
 * @Date 2019/11/14 14:55
 */
public enum InquiryCurrencyEnum {
    RMB("人民币", 1),
    DOLLAR("美元", 0);
    private String name;
    private Integer index;

    InquiryCurrencyEnum(String name, Integer index) {
        this.name = name;
        this.index = index;
    }
    public static String getName(int index) {
        for (InquiryCurrencyEnum c : InquiryCurrencyEnum.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }
    public static Integer getIndex(String name) {
        for (InquiryCurrencyEnum c : InquiryCurrencyEnum.values()) {
            if (c.getName().equals(name) ) {
                return c.index;
            }
        }
        return null;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }
}
